package main;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

public class ComprobarJugadoresSinCoincidir {
	private static Connection conexion;
	private static ArrayList<Integer> listaPartidas;
	/**
	 * @param args
	 * @throws ClassNotFoundException 
	 * @throws SQLException 
	 */
	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		// TODO Auto-generated method stub
		ResultSet rs; Statement st;
		ResultSet rs1; Statement st1;
		Class.forName("com.mysql.jdbc.Driver");
		conexion = DriverManager.getConnection("jdbc:mysql://localhost/proyecto", "root", "gracias");
		st = conexion.createStatement(); st1 = conexion.createStatement();
		listaPartidas = new ArrayList<Integer>();
		
		int partida = 54193460; int id; boolean esta = false;		
		rs = st.executeQuery("SELECT idPlayer FROM flageventsummaryplayer WHERE idMatch = '"+partida+"'");
		//rs = st.executeQuery("SELECT idPlayer FROM gamesummarymatchplayer WHERE idMatch = '"+partida+"'");
		while(rs.next()) {
			id = rs.getInt("idPlayer");
			rs1 = st1.executeQuery("SELECT idPlayer FROM gamesummarymatchplayer WHERE idMatch = '"+partida+"'");
			
			
			while(rs1.next() && !esta) {
				if(id == rs1.getInt("idPlayer")) esta = true; 
			}
			if(!esta) listaPartidas.add(id);
			esta = false;
		}
		
		
		
		for(int i = 0; i < listaPartidas.size(); i++)
				System.out.println(listaPartidas.get(i));
	}

}
